package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.MainPostBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;

@Mapper
public interface IMainPostMapper extends BaseMapper<MainPostBean> {

    public IPage<MainPostBean> cutFindByItem(Page<MainPostBean> page,
                                             @Param("channelID") Integer channelID,
                                             @Param("title") String title,
                                             @Param("userName")String userName,
                                             @Param("startDate")LocalDate startDate,
                                             @Param("endDate") LocalDate endDate);
    /**
     * 按主贴编号查询主贴信息，同时查询发贴人信息。同时列出该主贴中，所有回帖，在回贴信息中，需要回贴人信息。
     * @param mainPostID
     * @return
     */
    MainPostBean findByID(Integer mainPostID);
}
